package com.whl.project.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.whl.project.mapper.PermissionMapper;
import com.whl.project.model.PermissionResult;

@Service
public class PermissionService {
	@Autowired
	private PermissionMapper permissionMapper;

	public List<String> findByUserId(Long userId) {
		List<String> permissionResults = permissionMapper.findByUserId(userId);
		return permissionResults;
	}

	public List<String> findByRoleId(Long roleId) {
		List<String> permissions = permissionMapper.findByRoleId(roleId);
		return permissions;
	}

	public List<PermissionResult> findByNoLogin() {
		return permissionMapper.findByNoLogin();
	}
	
	public List<PermissionResult> findByGrant() {
		return permissionMapper.findByGrant();
	}

}
